credit2: Fix runq_tickle to use idle, tickled masks
The previous code had a bug where, if a second vcpu woke up and ran
runq_tickle before the first vcpu had actually started running on a
tickled processor, the code would choose the same cpu to tickle, and
the result would be a "missed tickle" -- only one of the vcpus would
run, despite having idle processors.
This change:
* Keeps a mask of idle cpus
* Keeps a mask of cpus which have been tickled, but not entered
schedule yet.
The new tickle code first looks at the set of idle-but-not-tickled
cpus; if it's not empty, it tickles one.
If that doesn't work, it looks at the set of not-idle-but-not-tickled
cpus, finds the one with the lowest credit; if that's lower than the
waking vcpu, it tickles that one.
If any cpu is tickled, its bit in the tickled mask is set, and cleared
when schedule() is called.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>